#pragma once

#include "GEnginePCH.h"

class Camera;
class Model;

class Entity
{
public:
	Entity( Model *m );
	~Entity(void);
	Model* GetModel(void);
	void Render(void);
	void Update(long deltaTime);
	D3DXVECTOR3 m_vPos, m_vRot, m_vScale, m_vDir, m_vTarget;
	float velocity;
	
protected:
	Model* model;
};

class Destructible : public Entity
{
public:
	Destructible(Model *m) : Entity(m) {}
	Destructible(Model *m, int maxHP) : Entity(m)
	{
		this->maxHP = maxHP;
		this->HP    = maxHP;
	}
	Destructible(Model *m, int HP, int maxHP) : Entity(m)
	{
		this->maxHP = maxHP;
		this->HP    = HP;
	}
	~Destructible(void){};
	void RenderHP( const D3DXMATRIX& matVP, Camera* camera );
	void RestoreDeviceObjects();
	void InvalidateDeviceObjects();
	int HP, maxHP;
protected:
	LPDIRECT3DVERTEXBUFFER9 VB ;
	LPDIRECT3DINDEXBUFFER9  IB ;

};

class Warrior : public Destructible
{
public:
	Warrior(Model *m) : Destructible(m) {}
	Warrior(Model *m, int maxHP, int damage, int armor) : Destructible(m, maxHP)
	{
		this->damage = damage;
		this->armor  = armor;
	}	
	Warrior(Model *m, int HP, int maxHP, int damage, int armor) : Destructible(m, HP, maxHP)
	{
		this->damage = damage;
		this->armor  = armor;
	}
	~Warrior(void){};
	void RenderStats();
	void RestoreDeviceObjects();
	void InvalidateDeviceObjects();

	int damage, armor;
protected:
	LPDIRECT3DVERTEXBUFFER9 VBs ;
	LPDIRECT3DINDEXBUFFER9  IBs ;
};